---------------------------------------------------
---------------------------------------------------
 Can Debt Financing Foster Innovation and Growth?
 Empirical Replication Code
 Thomas Geelen, Jakub Hajda, and Erwan Morellec
 Review of Financial Studies
 11-10-2021
---------------------------------------------------
---------------------------------------------------

This documents describes the code used to create Figure 1 and the data moments in Table 2.

The following data sets are required:
1) Annual Compustat enhanced with 'permno' from CRSP
2) United States Patent Data, 1926-2010 (Data version 05/2016) This data was collected for the paper:
Kogan, L., Papanikolaou, D., Seru, A. and Stoffman, N., 2017. Technological innovation, resource allocation, and growth. Quarterly Journal of Economics, 132(2), pp.665-712. 

The folder contains 4 scripts:
1) GHM_download_Compustat_data.sas - used to download the Compustat data from WRDS Confidential
2) GHM_data_import.do - used to import the Compustat data as well as the patent data to Stata
3) GHM_table2_data.do - used to process the data and to generate the data the data moments in Table 2
4) GHM_figure1.do - used to process the data and to generate the data for Figure 1

Further remarks:
1) Paths and working directories need to be adjusted so that the code can run properly. 
2) Two empty datasets ("compustat.dta" and "patent.dta") have been created to give an idea what the input data should look like.
3) Our code was run on StataMP 16 (64-bit).